package console;

import game.game;
import game.iAffichage;
import game.iMenu;
import level.Plateau;


public class Console implements iAffichage {

	game party;
	Surveille s;
	
	public void affichage(){
		Plateau p = party.getP();
		
		for (int x = 0; x < p.getPlateau().length+2; ++x)
	        System.out.print("#");
	    
		System.out.print("\n");
		
	    System.out.print("LEVEL "+p.getnLevel()+" | MS : "+p.getNbMulotSauve()+"/"+p.getMulotASauver()+"\n");		
		//#########################################################//
		
	    for (int x = 0; x < p.getPlateau().length+2; ++x)
	        System.out.print("#");
	    
	    System.out.print("\n");
	    
		for (int y = 0; y < p.getPlateau()[0].length; ++y) {
	    	System.out.print("|");
	      for (int x = 0; x < p.getPlateau().length; ++x)
	        System.out.print(p.getPlateau()[x][y]);
	      System.out.print("|");
	      System.out.println();
	    }
	}
	
	public void finGame(){
		Plateau p = party.getP();
		
		System.out.print("\n");
		System.out.print("\n");
		for (int x = 0; x < p.getPlateau().length+2; ++x)
	        System.out.print("#");
		
		if(p.levelWin()){
			System.out.print("\nVOUS AVEZ GAGNE LA PARTIE");
		}else{
			System.out.print("\nVOUS AVEZ PERDU LA PARTIE");
			System.exit(0);
		}
	}
	
	public void start() {		
		party = new game(this);
		party.start();
		
		s = new Surveille(party);
		s.start();
	}

	//Fonction utile qu'en mode graphique
	public void creatAff() {}
	public void destroyAff() {}
	public int getLargeur() {return 0;}
	public int getHauteur() {return 0;}
	public int getLargeur_plateau() {return 0;}
	public int getNbElem() {return 0;}
	public void setNbElem(int nbElem) {}
	public iMenu getMenu() {return null;}
	public void setMenu(iMenu menu) {}
	public game getParty() {return null;}
	public void setParty(game party) {}
	public int getMulotSelect() {return 0;}
	public void setMulotSelect(int mulotSelect) {}
	
}
